pushd %1
if exist XNetRPCList.def (del /f XNetRPCList.def)

set CMDS="cat base.proto entity.proto skill.proto lobby.proto level.proto task.proto match.proto item.proto hero.proto gm.proto | grep message | grep -v // | sed 's/\/+.*//g' | sed 's/message //g' | sed 's/\s*{*//g' | xargs -i echo XNET_RPC_SPECIFER\({}, PROTOID_{}, protoMsg::{}\) > XNetRPCList.def"

bash -c %CMDS%

SET CLIENT_NET_PATH=%2

if exist XNetRPCList.def (xcopy /Y XNetRPCList.def %CLIENT_NET_PATH%\)
if exist XNetRPCList.def (del /f XNetRPCList.def)
popd

pause